/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testing;

import java.util.List;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import services.AutoIncrementService;
/**
 *
 * @author node1
 */
public class AutoIncrementServiceClient {
    private void invoke() {
        TTransport transport;
        try {
            transport = new TFramedTransport(new TSocket("localhost", 7913));
            TProtocol protocol = new TBinaryProtocol(transport);

            AutoIncrementService.Client client = new AutoIncrementService.Client(protocol);
            transport.open();
            /*Gọi các phương thức trong service tại đây*/
            long t1 = System.currentTimeMillis();
            client.getAutoIncrement("Status");
            long t2 = System.currentTimeMillis();
            System.out.println(t2 - t1);
            transport.close();
        } catch (TTransportException e) {
        } catch (TException e) {
        }
    }
    public static void main(String[] args) {
        AutoIncrementServiceClient c = new AutoIncrementServiceClient();
        c.invoke();
    }    
}
